package com.gxar.quick.ar.server.base.common.enums;

import java.util.Arrays;

/**
 * 产品类别
 *
 * @author linsy
 * @version 1.0
 * @created 2024/2/4 13:45
 */
public enum ProductCategoryEnum {
    QUICK_AR(0, "QuickAR"),
    GOODS_PLUS_AR(1, "货+AR"),
    ;

    private final Integer code;

    private final String name;

    /**
     * 根据code查询
     *
     * @param code code
     * @return 响应
     */
    public static ProductCategoryEnum getByCode(Integer code) {
        return Arrays.stream(ProductCategoryEnum.values()).filter(e -> e.getCode().equals(code)).findFirst().orElse(null);
    }

    ProductCategoryEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }
}
